From 947830904239d51ec9e94971fed6346c1089911f Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 23 Jan 2023 19:01:28 +0100
Subject: chore: make Links and Images compliant with Next.js 13

---
 src/pages/projets/[slug].tsx | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

(limited to 'src/pages/projets/[slug].tsx')

diff --git a/src/pages/projets/[slug].tsx b/src/pages/projets/[slug].tsx
index 7539b55..79c3760 100644
--- a/src/pages/projets/[slug].tsx
+++ b/src/pages/projets/[slug].tsx
@@ -3,7 +3,9 @@ import SocialLink, {
   type SocialWebsite,
 } from '@components/atoms/links/social-link';
 import Spinner from '@components/atoms/loaders/spinner';
-import ResponsiveImage from '@components/molecules/images/responsive-image';
+import ResponsiveImage, {
+  ResponsiveImageProps,
+} from '@components/molecules/images/responsive-image';
 import Code from '@components/molecules/layout/code';
 import Gallery from '@components/organisms/images/gallery';
 import Overview, {
@@ -40,6 +42,10 @@ import Script from 'next/script';
 import { ComponentType } from 'react';
 import { useIntl } from 'react-intl';
 
+const BorderedImage = (props: ResponsiveImageProps) => {
+  return <ResponsiveImage withBorders={true} {...props} />;
+};
+
 type ProjectPageProps = {
   project: ProjectPreview;
   translation: Messages;
@@ -65,10 +71,10 @@ const ProjectPage: NextPageWithLayout<ProjectPageProps> = ({ project }) => {
   );
 
   const components: NestedMDXComponents = {
-    Code: (props) => <Code {...props} />,
-    Gallery: (props) => <Gallery {...props} />,
-    Image: (props) => <ResponsiveImage withBorders={true} {...props} />,
-    Link: (props) => <Link {...props} />,
+    Code: Code,
+    Gallery: Gallery,
+    Image: BorderedImage,
+    Link: Link,
   };
 
   const { website } = useSettings();
-- 
cgit v1.2.3

